﻿namespace SalesPortal.Web.Helpers
{
    using System.Runtime.Remoting.Metadata.W3cXsd2001;

    public class TranslationHelper
    {
        public byte[] HexStringToBytes(string hexString)
        {
            byte[] result = null;

            try
            {
                SoapHexBinary hexBin = SoapHexBinary.Parse(hexString);
                result = hexBin.Value;
                return result;
            }
            catch
            {
                return result;
            }
        }

        public string BytesToHexString(byte[] bytes)
        {
            string result = string.Empty;

            try
            {
                SoapHexBinary hexBin = new SoapHexBinary(bytes);
                result = hexBin.ToString();
                return result;
            }
            catch
            {
                return result;
            }

        }
    } // public class TranslationHelper
}